﻿using TestBat.IViewModels.Base;

namespace TestBat.ViewModels.Base
{
    public abstract class TreeItemViewModel : ViewModel, ITreeItemViewModel
    {
        public TreeItemViewModel()
        {
            this.isSelected = false;
        }

        public bool IsSelected
        {
            set
            {
                isSelected = value;

                if (isSelected)
                    PreSelect(this);
            }
            get { return isSelected; }
        }

        public abstract void OnLostFocus();

        public Removed OnRemove { get; set; }

        public Selected PreSelect { get; set; }

        private bool isSelected;
    }
}
